home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / printing / ddrvprev / rvtest.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-12-09  |  24.0 KB  |  678 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Test DDRV.DLL"
  6.    ClientHeight    =   5055
  7.    ClientLeft      =   1680
  8.    ClientTop       =   1530
  9.    ClientWidth     =   8160
  10.    Height          =   5460
  11.    Left            =   1620
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   5055
  15.    ScaleWidth      =   8160
  16.    Top             =   1185
  17.    Width           =   8280
  18.    Begin Frame Frame5 
  19.       BackColor       =   &H00C0C0C0&
  20.       Caption         =   "Edit Box"
  21.       Height          =   2400
  22.       Left            =   195
  23.       TabIndex        =   22
  24.       Top             =   2445
  25.       Width           =   2355
  26.       Begin CommandButton btnShow 
  27.          BackColor       =   &H00000000&
  28.          Caption         =   "Show"
  29.          Height          =   405
  30.          Left            =   1170
  31.          TabIndex        =   25
  32.          Top             =   1935
  33.          Width           =   1005
  34.       End
  35.       Begin CommandButton btnNoLines 
  36.          BackColor       =   &H00000000&
  37.          Caption         =   "No. Lines"
  38.          Height          =   405
  39.          Left            =   165
  40.          TabIndex        =   24
  41.          Top             =   1935
  42.          Width           =   1020
  43.       End
  44.       Begin TextBox txtEditBox 
  45.          FontBold        =   0   'False
  46.          FontItalic      =   0   'False
  47.          FontName        =   "MS Sans Serif"
  48.          FontSize        =   8.25
  49.          FontStrikethru  =   0   'False
  50.          FontUnderline   =   0   'False
  51.          Height          =   1605
  52.          Left            =   165
  53.          MultiLine       =   -1  'True
  54.          TabIndex        =   23
  55.          Text            =   "This is some text that wraps around in an edit box. DDRV.DLL has functions to return the contents of a line in the edit box and the number of lines in the box."
  56.          Top             =   345
  57.          Width           =   2010
  58.       End
  59.    End
  60.    Begin Frame Frame2 
  61.       BackColor       =   &H00C0C0C0&
  62.       Caption         =   "Window && Grapics"
  63.       Height          =   2940
  64.       Left            =   2685
  65.       TabIndex        =   16
  66.       Top             =   585
  67.       Width           =   3180
  68.       Begin CheckBox chkDeleteTemp 
  69.          Alignment       =   1  'Right Justify
  70.          BackColor       =   &H00C0C0C0&
  71.          Caption         =   "Delete the temp file"
  72.          FontBold        =   0   'False
  73.          FontItalic      =   0   'False
  74.          FontName        =   "MS Sans Serif"
  75.          FontSize        =   8.25
  76.          FontStrikethru  =   0   'False
  77.          FontUnderline   =   0   'False
  78.          Height          =   225
  79.          Left            =   420
  80.          TabIndex        =   30
  81.          Top             =   1860
  82.          Value           =   1  'Checked
  83.          Width           =   2200
  84.       End
  85.       Begin CommandButton btnFloat 
  86.          BackColor       =   &H00000000&
  87.          Caption         =   "Float It"
  88.          Height          =   435
  89.          Left            =   1635
  90.          TabIndex        =   28
  91.          Top             =   2385
  92.          Width           =   1365
  93.       End
  94.       Begin CommandButton btnHandle 
  95.          BackColor       =   &H00000000&
  96.          Caption         =   "Viewer hWnd"
  97.          Height          =   435
  98.          Left            =   135
  99.          TabIndex        =   27
  100.          Top             =   2385
  101.          Width           =   1365
  102.       End
  103.       Begin CheckBox chkHideDefault 
  104.          Alignment       =   1  'Right Justify
  105.          BackColor       =   &H00C0C0C0&
  106.          Caption         =   "Hide Default Printer Button"
  107.          FontBold        =   0   'False
  108.          FontItalic      =   0   'False
  109.          FontName        =   "MS Sans Serif"
  110.          FontSize        =   8.25
  111.          FontStrikethru  =   0   'False
  112.          FontUnderline   =   0   'False
  113.          Height          =   225
  114.          Left            =   420
  115.          TabIndex        =   26
  116.          Top             =   1620
  117.          Width           =   2200
  118.       End
  119.       Begin CheckBox chkAltHints 
  120.          Alignment       =   1  'Right Justify
  121.          BackColor       =   &H00C0C0C0&
  122.          Caption         =   "Alternate Buttons"
  123.          FontBold        =   0   'False
  124.          FontItalic      =   0   'False
  125.          FontName        =   "MS Sans Serif"
  126.          FontSize        =   8.25
  127.          FontStrikethru  =   0   'False
  128.          FontUnderline   =   0   'False
  129.          Height          =   225
  130.          Left            =   420
  131.          TabIndex        =   21
  132.          Top             =   660
  133.          Width           =   2200
  134.       End
  135.       Begin CheckBox chkControlBox 
  136.          Alignment       =   1  'Right Justify
  137.          BackColor       =   &H00C0C0C0&
  138.          Caption         =   "Show Control Box"
  139.          FontBold        =   0   'False
  140.          FontItalic      =   0   'False
  141.          FontName        =   "MS Sans Serif"
  142.          FontSize        =   8.25
  143.          FontStrikethru  =   0   'False
  144.          FontUnderline   =   0   'False
  145.          Height          =   225
  146.          Left            =   420
  147.          TabIndex        =   20
  148.          Top             =   420
  149.          Width           =   2200
  150.       End
  151.       Begin CheckBox chkViewFirst 
  152.          Alignment       =   1  'Right Justify
  153.          BackColor       =   &H00C0C0C0&
  154.          Caption         =   "View First"
  155.          FontBold        =   0   'False
  156.          FontItalic      =   0   'False
  157.          FontName        =   "MS Sans Serif"
  158.          FontSize        =   8.25
  159.          FontStrikethru  =   0   'False
  160.          FontUnderline   =   0   'False
  161.          Height          =   225
  162.          Left            =   420
  163.          TabIndex        =   19
  164.          Top             =   900
  165.          Value           =   1  'Checked
  166.          Width           =   2200
  167.       End
  168.       Begin CheckBox chkMagnify 
  169.          Alignment       =   1  'Right Justify
  170.          BackColor       =   &H00C0C0C0&
  171.          Caption         =   "Show Magnify "
  172.          FontBold        =   0   'False
  173.          FontItalic      =   0   'False
  174.          FontName        =   "MS Sans Serif"
  175.          FontSize        =   8.25
  176.          FontStrikethru  =   0   'False
  177.          FontUnderline   =   0   'False
  178.          Height          =   225
  179.          Left            =   420
  180.          TabIndex        =   18
  181.          Top             =   1140
  182.          Value           =   1  'Checked
  183.          Width           =   2200
  184.       End
  185.       Begin CheckBox chkPrintSelect 
  186.          Alignment       =   1  'Right Justify
  187.          BackColor       =   &H00C0C0C0&
  188.          Caption         =   "Show Print Select"
  189.          FontBold        =   0   'False
  190.          FontItalic      =   0   'False
  191.          FontName        =   "MS Sans Serif"
  192.          FontSize        =   8.25
  193.          FontStrikethru  =   0   'False
  194.          FontUnderline   =   0   'False
  195.          Height          =   225
  196.          Left            =   420
  197.          TabIndex        =   17
  198.          Top             =   1380
  199.          Value           =   1  'Checked
  200.          Width           =   2200
  201.       End
  202.    End
  203.    Begin CommandButton btnTest 
  204.       BackColor       =   &H00000000&
  205.       Caption         =   "&Test"
  206.       Height          =   495
  207.       Left            =   6090
  208.       TabIndex        =   15
  209.       Top             =   3660
  210.       Width           =   1905
  211.    End
  212.    Begin Frame Frame1 
  213.       BackColor       =   &H00C0C0C0&
  214.       Caption         =   "Window State"
  215.       Height          =   1755
  216.       Left            =   195
  217.       TabIndex        =   11
  218.       Top             =   615
  219.       Width           =   2340
  220.       Begin OptionButton optMinMax 
  221.          BackColor       =   &H00C0C0C0&
  222.          Caption         =   "Normal"
  223.          Height          =   195
  224.          Index           =   0
  225.          Left            =   420
  226.          TabIndex        =   14
  227.          Top             =   540
  228.          Value           =   -1  'True
  229.          Width           =   1350
  230.       End
  231.       Begin OptionButton optMinMax 
  232.          BackColor       =   &H00C0C0C0&
  233.          Caption         =   "Minimized"
  234.          Height          =   195
  235.          Index           =   1
  236.          Left            =   420
  237.          TabIndex        =   13
  238.          Top             =   915
  239.          Width           =   1410
  240.       End
  241.       Begin OptionButton optMinMax 
  242.          BackColor       =   &H00C0C0C0&
  243.          Caption         =   "Maximized"
  244.          Height          =   195
  245.          Index           =   2
  246.          Left            =   420
  247.          TabIndex        =   12
  248.          Top             =   1275
  249.          Width           =   1380
  250.       End
  251.    End
  252.    Begin CommandButton btnDone 
  253.       BackColor       =   &H00000000&
  254.       Caption         =   "&Done"
  255.       Height          =   495
  256.       Left            =   6075
  257.       TabIndex        =   10
  258.       Top             =   4350
  259.       Width           =   1905
  260.    End
  261.    Begin Frame Frame3 
  262.       BackColor       =   &H00C0C0C0&
  263.       Caption         =   "Orientation"
  264.       Height          =   1260
  265.       Left            =   2685
  266.       TabIndex        =   7
  267.       Top             =   3585
  268.       Width           =   3195
  269.       Begin OptionButton optOrentation 
  270.          BackColor       =   &H00C0C0C0&
  271.          Caption         =   "Portrait"
  272.          Height          =   240
  273.          Index           =   0
  274.          Left            =   540
  275.          TabIndex        =   9
  276.          Top             =   420
  277.          Value           =   -1  'True
  278.          Width           =   1440
  279.       End
  280.       Begin OptionButton optOrentation 
  281.          BackColor       =   &H00C0C0C0&
  282.          Caption         =   "Landscape"
  283.          Height          =   240
  284.          Index           =   1
  285.          Left            =   540
  286.          TabIndex        =   8
  287.          Top             =   780
  288.          Width           =   1425
  289.       End
  290.    End
  291.    Begin Frame Frame4 
  292.       BackColor       =   &H00C0C0C0&
  293.       Caption         =   "Initial Zoom State"
  294.       Height          =   2925
  295.       Left            =   6015
  296.       TabIndex        =   2
  297.       Top             =   570
  298.       Width           =   1950
  299.       Begin CommandButton btnKill 
  300.          BackColor       =   &H00000000&
  301.          Caption         =   "Kill Viewer"
  302.          Height          =   435
  303.          Left            =   300
  304.          TabIndex        =   29
  305.          Top             =   2310
  306.          Width           =   1365
  307.       End
  308.       Begin OptionButton chkZoom 
  309.          BackColor       =   &H00C0C0C0&
  310.          Caption         =   "100%"
  311.          Height          =   270
  312.          Index           =   0
  313.          Left            =   390
  314.          TabIndex        =   6
  315.          Top             =   450
  316.          Width           =   1380
  317.       End
  318.       Begin OptionButton chkZoom 
  319.          BackColor       =   &H00C0C0C0&
  320.          Caption         =   "75%"
  321.          Height          =   270
  322.          Index           =   1
  323.          Left            =   375
  324.          TabIndex        =   5
  325.          Top             =   915
  326.          Width           =   1380
  327.       End
  328.       Begin OptionButton chkZoom 
  329.          BackColor       =   &H00C0C0C0&
  330.          Caption         =   "50%"
  331.          Height          =   270
  332.          Index           =   2
  333.          Left            =   390
  334.          TabIndex        =   4
  335.          Top             =   1380
  336.          Width           =   1380
  337.       End
  338.       Begin OptionButton chkZoom 
  339.          BackColor       =   &H00C0C0C0&
  340.          Caption         =   "Zoom to fit"
  341.          Height          =   270
  342.          Index           =   3
  343.          Left            =   390
  344.          TabIndex        =   3
  345.          Top             =   1830
  346.          Value           =   -1  'True
  347.          Width           =   1380
  348.       End
  349.    End
  350.    Begin Label Label1 
  351.       Alignment       =   2  'Center
  352.       BackColor       =   &H00000000&
  353.       Caption         =   "Copyright 1995, Don Dickinson - 72762,645 on CompuServe"
  354.       FontBold        =   0   'False
  355.       FontItalic      =   0   'False
  356.       FontName        =   "MS Sans Serif"
  357.       FontSize        =   8.25
  358.       FontStrikethru  =   0   'False
  359.       FontUnderline   =   0   'False
  360.       ForeColor       =   &H00FFFFFF&
  361.       Height          =   360
  362.       Index           =   0
  363.       Left            =   -30
  364.       TabIndex        =   0
  365.       Top             =   120
  366.       Width           =   8205
  367.       WordWrap        =   -1  'True
  368.    End
  369.    Begin Label Label1 
  370.       Alignment       =   2  'Center
  371.       BackColor       =   &H00000000&
  372.       FontBold        =   0   'False
  373.       FontItalic      =   0   'False
  374.       FontName        =   "MS Sans Serif"
  375.       FontSize        =   8.25
  376.       FontStrikethru  =   0   'False
  377.       FontUnderline   =   0   'False
  378.       ForeColor       =   &H00FFFFFF&
  379.       Height          =   360
  380.       Index           =   1
  381.       Left            =   0
  382.       TabIndex        =   1
  383.       Top             =   0
  384.       Width           =   8190
  385.       WordWrap        =   -1  'True
  386.    End
  387. Option Explicit
  388. Sub btnDone_Click ()
  389.     End
  390. End Sub
  391. Sub btnFloat_Click ()
  392.     Dim hWnd%
  393. ' -- Get the viewer handle
  394.     hWnd% = rvGetHandle()
  395. ' -- Check to see if the viewer exists
  396.     If rvViewerActive(hWnd%) <> 0 Then
  397.         MsgBox "There is no viewer"
  398.     Else
  399.         ' If it exists, float the window
  400.         Call rvFloatViewer(hWnd%, 1)
  401.     End If
  402. End Sub
  403. Sub btnHandle_Click ()
  404.     Dim hWnd%
  405. ' -- Get the handle for the viewer
  406.     hWnd% = rvGetHandle()
  407. ' -- Check to see if the handle is valid
  408.     If rvViewerActive(hWnd%) <> 0 Then
  409.         MsgBox "There is no viewer"
  410.     Else
  411.         MsgBox "The Viewer handle is" & Str$(hWnd%)
  412.     End If
  413. ' -- Check for the close handle
  414.     hWnd% = rvGetCloseHandle()
  415.     If hWnd% > 0 Then
  416.         MsgBox "The close handle is:" & Str$(hWnd%)
  417.     Else
  418.         MsgBox "Couldn't get the close handle"
  419.     End If
  420. End Sub
  421. Sub btnKill_Click ()
  422.     Dim hWndClose%
  423.     hWndClose% = rvGetCloseHandle()
  424.     If hWndClose% > 0 Then Call rvKillViewer(hWndClose%)
  425.     DoEvents
  426. End Sub
  427. Sub btnNoLines_Click ()
  428.     Dim a&, Which&
  429.     Dim Buffer As String * 1000
  430. ' -- Get the number of lines in the edit box
  431.     Which& = 0
  432.     ' If we pass Which& = 0 then after the call
  433.     ' Which& will contain the number of lines
  434.     ' in the edit box. The Buffer parameter is
  435.     ' unused in this call.
  436.     rvGetEditBoxLine txtEditBox.hWnd, Which&, Buffer
  437.     MsgBox "The edit box contains" & Str$(Which&) & " Lines."
  438. End Sub
  439. Sub btnShow_Click ()
  440.     Dim a&, HowManyLines&, WhichLine&
  441.     Dim Buffer As String * 1000
  442.     Buffer = Space$(1000)
  443. ' -- Get the number of lines in the edit box
  444.     HowManyLines& = 0
  445.     ' If we pass Which& = 0 then after the call
  446.     ' Which& will contain the number of lines
  447.     ' in the edit box. The Buffer parameter is
  448.     ' unused in this call.
  449.     rvGetEditBoxLine txtEditBox.hWnd, HowManyLines&, Buffer
  450.     MsgBox "No Lines:" & Str$(HowManyLines&)
  451. ' -- Show the contents of each line
  452.     For a& = 1 To HowManyLines&
  453.         ' Make the call to get the contents
  454.         ' of the a&th line in the edit box.
  455.         ' The Buffer parameter will return
  456.         ' containing the contents of the
  457.         ' edit box line. The idx& parameter will
  458.         ' contain the number of characters in
  459.         ' the line. You must make sure that
  460.         ' Buffer is "pre-dimmed" to hold
  461.         ' enough characters - 1000 is a safe
  462.         ' bet.
  463.         WhichLine& = a&
  464.         rvGetEditBoxLine txtEditBox.hWnd, WhichLine&, Buffer
  465.         MsgBox Left$(Buffer, WhichLine&)
  466.     Next a&
  467. End Sub
  468. Sub btnTest_Click ()
  469.     Dim Title$, GraphicFile$, a%, e%
  470.     Dim DisplayCtlBox%, MinMaxOrLeft%
  471.     Dim TheOptions%, ViewOrPrint%
  472.     Dim b&, HowManyLines&, WhichLine&
  473.     Dim Buffer As String * 1000
  474.     Dim Tempfile As String * 129
  475.     Dim cy!, lh!    'cy! will be used to track the current
  476.                     'y position on the page when printing
  477.                     'lines of text. lh! is the height
  478.                     'of the line feed in inches
  479.     lh! = .2
  480.     Title$ = "Test RV"
  481. ' -- Setup the page orientation
  482.     If optOrentation(0).Value = True Then
  483.         TheOptions% = RV_PORTRAIT
  484.     Else
  485.         TheOptions% = RV_LANDSCAPE
  486.     End If
  487. ' -- Check for magnify glass
  488.     If chkMagnify.Value = 1 Then TheOptions% = TheOptions% + RV_MAGNIFY
  489. ' -- Check for allowing printer/page selection common dialog
  490.     If chkPrintSelect = 1 Then TheOptions% = TheOptions% + RV_PRINTSELECT
  491. ' -- Check if we delete the temp file
  492.     If chkDeleteTemp.Value = 0 Then TheOptions% = TheOptions% + RV_SAVETEMPFILE
  493. ' -- Check the zoom level
  494.     If chkZoom(0).Value = True Then
  495.         TheOptions% = TheOptions% + RV_ZOOM100
  496.     ElseIf chkZoom(1).Value = True Then
  497.         TheOptions% = TheOptions% + RV_ZOOM75
  498.     ElseIf chkZoom(2).Value = True Then
  499.         TheOptions% = TheOptions% + RV_ZOOM50
  500.     Else
  501.         TheOptions% = TheOptions% + RV_ZOOMFIT
  502.     End If
  503. ' -- Check to see if we want to hide the default printer button
  504.     If chkHideDefault = 1 Then TheOptions% = TheOptions% + RV_HIDEDEFPRINTER
  505. ' -- Check if we need to view first or just print
  506.     If chkViewFirst.Value = 1 Then
  507.         ViewOrPrint% = RV_VIEWFIRST
  508.     Else
  509.         ViewOrPrint% = RV_JUSTPRINT
  510.     End If
  511. ' -- Initialize the viewer
  512.     a% = rvInit(Form1.hWnd, Title$, ViewOrPrint%, RV_INCH, TheOptions%)
  513. ' -- Set the name, style and size of the font.
  514. '    This should be done right after you
  515. '    initialize the viewer, every time you
  516. '    initialze the viewer, as the initial
  517. '    values of the font properties can cause
  518. '    some weird things to happen.
  519. '    In addition, if you are allowing the user
  520. '    to print a range of pages, you should
  521. '    initialize the name, size, and style
  522. '    after each rvNewPage call, or the same
  523. '    type of uninitialed font property
  524. '    weirdness will occur.
  525.     rvFontStyle RV_FONTBOLD Or RV_FONTITALIC
  526.     rvFontSize 12
  527.     rvFontName "Arial"
  528. ' -- Should we show the control box?
  529.     If chkControlBox.Value = 1 Then
  530.         DisplayCtlBox% = RV_CTLBOX
  531.     Else
  532.         DisplayCtlBox% = RV_NOCTLBOX
  533.     End If
  534. ' -- If we want the screen to be minimized or maximized,
  535. '    we indicate this by passing a special constant in
  536. '    the X parameter.
  537.     If optMinMax(0).Value = True Then
  538.         MinMaxOrLeft% = 10
  539.     ElseIf optMinMax(1).Value = True Then
  540.         MinMaxOrLeft% = RV_MINIMIZE
  541.     Else
  542.         MinMaxOrLeft% = RV_MAXIMIZE
  543.     End If
  544. ' -- Do we
  545. ' -- Set the viewer's initial position
  546. '    start position (or min, max )
  547. '    width = 600 pixels
  548. '    height = 450 pixels
  549. '    Show the control box (yes or no)
  550.     rvViewerPos MinMaxOrLeft%, 10, 600, 450, DisplayCtlBox%
  551. ' -- Set some alternate captions for the buttons if requested
  552.     If chkAltHints.Value = 1 Then
  553.         rvButtons 84, 10, App.Path & "\ALT_TOOL.BMP"
  554.         rvButtonCaption RV_BTN_EXIT, "Alt Exit Hint"
  555.         rvButtonCaption RV_BTN_PREV, "Alt Prev Hint"
  556.         rvButtonCaption RV_BTN_NEXT, "Alt Next Hint"
  557.         rvButtonCaption RV_BTN_PRINT, "Alt Print Hint"
  558.         rvButtonCaption RV_BTN_CHOOSEPRINT, "Alt Printer Hint"
  559.         rvButtonCaption RV_CBO_ZOOM, "Alt Zoom Hint"
  560.     End If
  561. ' -- Place a graphic on the screen
  562.     GraphicFile$ = App.Path & "\ddrv.bmp"
  563.     rvGraphic GraphicFile$, 1, 1, 5, 3.5
  564. ' -- Print some sideways text
  565.     rvFontSize 36
  566.     rvFontStyle RV_FONTBOLD
  567.     rvAngleText 8, 1, 270, "DDRV Print Preview Shareware" + Chr$(0)
  568.     rvFontSize 14
  569.     rvFontStyle RV_FONTNORMAL
  570. ' -- Line feed a paragraph directly from the edit box.
  571. '    this is a fairly accurate method for printing
  572. '    paragraphs of text out to the viewer. Set the
  573. '    fontname, size, etc. of the edit box to be
  574. '    the same as the rvFontName, etc. Then set the
  575. '    width of the viewer to be the width you
  576. '    want the text to fit in.
  577. '    ----
  578. '    in "real" applications you would want to
  579. '    create an invisible multi-line edit box
  580. '    for use in printing like this.
  581.     On Error Resume Next
  582.     ' Hard coding a font name is a dangerous thing.
  583.     ' if you assign an invalid name to a control
  584.     ' you get a runtime error
  585.     txtEditBox.FontName = "Arial"
  586.     txtEditBox.FontSize = 14
  587.     On Error GoTo 0
  588.     DoEvents
  589. ' -- Get the number of lines in the edit box
  590.     Buffer = Space$(1000)
  591.     HowManyLines& = 0
  592.     'This call returns the number of lines in txtEditBox
  593.     'in the HowManyLines& parameter.
  594.     rvGetEditBoxLine txtEditBox.hWnd, HowManyLines&, Buffer
  595. ' -- Print the contents of each line
  596.     cy! = 7.75 'This is the starting Y position on the page
  597.     For b& = 1 To HowManyLines&
  598.         WhichLine& = b&
  599.         'This function returns the contents of the
  600.         'line (WhichLine&) in txtEditBox in the
  601.         'string Buffer. WhichLine& returns containing
  602.         'the character count in Buffer.
  603.         rvGetEditBoxLine txtEditBox.hWnd, WhichLine&, Buffer
  604.         rvText 1, cy!, RV_LEFT, Left$(Buffer, WhichLine&)
  605.         cy! = cy! + lh!
  606.     Next b&
  607. ' -- for my final trick - some text at lots of angles
  608.     rvFontSize 12
  609.     For a% = 0 To 360 Step 72
  610.         rvAngleText 4, 6, a%, "This is some text at weird angles"
  611.     Next a%
  612. ' -- Call a new page
  613.     rvNewPage
  614. ' -- Set the font attributes for the new page
  615. '    REMEMBER to do this after rvInit and
  616. '    after each call to rvNewPage !!
  617.     rvFontName "Arial"
  618.     rvFontSize 10
  619.     rvFontStyle RV_FONTBOLD
  620. ' -- Print out some text
  621.     rvText 4.25, .5, RV_CENTER, "Text can be printed in any position and alignment"
  622. ' -- Change the font size and style and print more text
  623.     rvFontSize 12
  624.     rvFontStyle RV_FONTNORMAL
  625.     rvText .5, .5, RV_LEFT, "(.5, .5) is this position"
  626.     If (TheOptions% And RV_PORTRAIT) = RV_PORTRAIT Then
  627.         rvText .5, 10.5, RV_LEFT, "(.5, 8) is this position"
  628.         rvText 8, .5, RV_RIGHT, "(8, .5) is this position"
  629.         rvText 8, 10.5, RV_RIGHT, "(8, 10.5) is this position"
  630.     Else
  631.         rvText .5, 8, RV_LEFT, "(.5, 10.5) is this position"
  632.         rvText 10.5, .5, RV_RIGHT, "(10.5, 0) is this position"
  633.         rvText 10.5, 8, RV_RIGHT, "(10.5, 8) is this position"
  634.     End If
  635. ' -- Change the font size and style
  636.     rvFontSize 10
  637.     rvFontStyle RV_FONTBOLD
  638. ' -- Show the different alignments
  639.     rvText 4, 3, RV_LEFT, "Left Text - 4 inches"
  640.     rvText 4, 3.2, RV_RIGHT, "Right Text - 4 inches"
  641.     rvText 4, 3.4, RV_CENTER, "Center Text - 4 inches"
  642.     rvText 4, 3.6, RV_DECIMAL, "Decimal (4 inches) $90.00"
  643. ' -- Draw a fine line (horizontal)
  644.     rvLine 1, 3, 7, 3, 0
  645. ' -- Draw a 1 point line (vertical)
  646.     rvLine 4, 1, 4, 6, 1
  647. ' -- Start a new page
  648.     rvNewPage
  649. ' -- Change the font style back to normal
  650.     rvFontName "Arial"
  651.     rvFontStyle RV_FONTNORMAL
  652. ' -- Change Font Size to 24 point
  653.     rvFontSize 24
  654. ' -- Print the text again
  655.     rvText 4.25, .5, RV_CENTER, "Some Bitmaps"
  656. ' -- Draw a rectangle
  657.     rvRect .5, 6.5, 4.5, 8.5, 2, RV_CLEARBACK
  658. ' -- Draw a graphic a few times, stretch it different ways
  659.     GraphicFile$ = App.Path & "\test.bmp"
  660.     rvGraphic GraphicFile$, .5, .5, 1, 1
  661.     rvGraphic GraphicFile$, 1, 2, 4, 5
  662.     rvGraphic GraphicFile$, 7, 7, 8, 8
  663.     rvGraphic GraphicFile$, 1, 7, 4, 8
  664.     rvGraphic GraphicFile$, 6, 1, 7, 5
  665.     rvRect 6, 1, 7, 5, 2, RV_GREYBACK
  666.     rvFontSize 16
  667.     rvParagraph 5, 6, 7, 9, "This is a whole big line of word-wrapped text. It is wrapped using the rvParagraph command."
  668. ' -- Get the name of the temp file
  669. '    this is not used right now, but sometimes
  670. '    it is nice to know. You don't need to call
  671. '    this unless you want to know the name of the
  672. '    page description file.
  673.     e% = rvWhatIsTempFile(Tempfile)
  674.     MsgBox "A page description temp file has been created: " + Chr$(13) + Chr$(10) + Left$(Tempfile, e) + Chr$(13) + Chr$(10) + " The viewer will now start."
  675. ' -- End the document
  676.     rvEndDoc
  677. End Sub
  678.